﻿// "Therefore those skilled at the unorthodox
// are infinite as heaven and earth,
// inexhaustible as the great rivers.
// When they come to an end,
// they bagin again,
// like the days and months;
// they die and are reborn,
// like the four seasons."
// 
// - Sun Tsu,
// "The Art of War"

using log4net.Core;

namespace Infrastructure.Logging
{
    /// <summary>
    /// Interface for objects that require fixing.
    /// </summary>
    /// <remarks>
    /// <para>
    /// Interface that indicates that the object requires fixing before it
    /// can be taken outside the context of the appender's 
    /// <see cref="log4net.Appender.IAppender.DoAppend"/> method.
    /// </para>
    /// <para>
    /// When objects that implement this interface are stored 
    /// in the context properties maps <see cref="log4net.GlobalContext"/>
    /// <see cref="log4net.GlobalContext.Properties"/> and <see cref="log4net.ThreadContext"/>
    /// <see cref="log4net.ThreadContext.Properties"/> are fixed 
    /// (see <see cref="LoggingEvent.Fix"/>) the <see cref="log4net.Core.IFixingRequired.GetFixedObject"/>
    /// method will be called.
    /// </para>
    /// </remarks>
    /// <author>Nicko Cadell</author>
    public interface IFixingRequired
    {
        /// <summary>
        /// Get a portable version of this object
        /// </summary>
        /// <returns>the portable instance of this object</returns>
        /// <remarks>
        /// <para>
        /// Get a portable instance object that represents the current
        /// state of this object. The portable object can be stored
        /// and logged from any thread with identical results.
        /// </para>
        /// </remarks>
        object GetFixedObject();
    }
}
